package p.ithorns.integration.transform.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import p.ithorns.integration.transform.entity.Order;

/**
 * OrderMapper
 *
 * @author ithorns
 * @version 1.0
 * @date 2019/11/11 11:26
 */
@Repository
public interface OrderMapper extends BaseMapper<Order> {


    /*
    private final static ConcurrentHashMap<Serializable, Order> DB = new ConcurrentHashMap<>();

    private final SnowFlakeIdGenerator idGenerator = new SnowFlakeIdGenerator(1, 1);

    public void update(Order order) {
        Serializable id = order.getId();
        Order old = DB.get(id);
        BeanUtils.copyProperties(order, old);
        DB.put(id, old);
        log.debug(DB.toString());
    }

    public Order get(Serializable id) {
        return DB.get(id);
    }

    public Order save(Order order) {
        long id = idGenerator.nextId();
        order.setId(id);
        DB.put(id, order);
        log.debug(DB.toString());
        return order;
    }

    public void remove(Serializable id) {
        DB.remove(id);
        log.debug(DB.toString());
    }
    */

}
